import 'package:flutter/material.dart';

class CreditCard extends StatefulWidget {
  final CreditCardViewModel data;
  const CreditCard({Key key, this.data}) : super(key: key);
  @override
  CcreditCardState createState() => CcreditCardState();
}

class CcreditCardState extends State<CreditCard> {
  @override
  Widget build(BuildContext context) {
    return Container(
      height: 180,
      child: Stack(
        children: [
          Image.asset(
            widget.data.bankLogoUrl,
            width: 250,
            height: 250,
            color: Colors.white10,
          ),
        ],
      ),
    );
  }
}

class CreditCardViewModel {
  /// 银行
  final String bankName;

  /// 银行Logo
  final String bankLogoUrl;

  /// 卡类型
  final String cardType;

  /// 卡号
  final String cardNumber;

  /// 卡片颜色
  final List<Color> cardColors;

  /// 有效期
  final String validDate;

  const CreditCardViewModel({
    this.bankName,
    this.bankLogoUrl,
    this.cardType,
    this.cardNumber,
    this.cardColors,
    this.validDate,
  });
}
